home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.4 KB | 130 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWCursor.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #if !defined(FWCURSOR_H) && !defined(__ODFRC__)
- #define FWCURSOR_H
-
- #ifndef FWCURSOR_K
- #include "FWCursor.k"
- #endif
-
- #ifndef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- //========================================================================================
- // Forward Class Declarations
- //========================================================================================
-
- class FW_PResourceFile;
- class FW_CCursor;
-
- //========================================================================================
- // Predefined cursors
- //========================================================================================
-
- extern const FW_CCursor FW_gArrowCursor;
- extern const FW_CCursor FW_gIBeamCursor;
- extern const FW_CCursor FW_gCrossHairCursor;
- extern const FW_CCursor FW_gWaitCursor;
- extern const FW_CCursor FW_gOpenHandCursor;
- extern const FW_CCursor FW_gClosedHandCursor;
- extern const FW_CCursor FW_gSizeWECursor;
- extern const FW_CCursor FW_gSizeNSCursor;
- extern const FW_CCursor FW_gSizeNWSECursor;
- extern const FW_CCursor FW_gSizeNESWCursor;
-
- //========================================================================================
- // FW_CCursor
- //========================================================================================
-
- class FW_CCursor
- {
-
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- FW_DECLARE_AUTO(FW_CCursor)
-
- FW_CCursor();
- // Create an arrow cursor
-
- FW_CCursor(FW_CursorID cursorID, FW_Instance instance = NULL);
- // loads a cursor
-
- virtual~ FW_CCursor();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- static void Show();
- static void Hide();
- void Select() const;
-
- FW_PlatformCursorHandle GetHandle() const;
- // Attention (Mac Only): GetHandle will return NULL for the Arrow Cursor because the
- // arrow cursor is a pointer not a handle.
-
- protected:
- void PrivLoadCursor();
-
- private:
- FW_CCursor(const FW_CCursor& other);
- FW_CCursor& operator=(const FW_CCursor& other);
- // Copy constructor and assignment operator not valid for this class.
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- private:
- FW_PlatformCursorHandle fCursorHandle;
-
- FW_Instance fInstance;
- FW_CursorID fCursorID;
- FW_Boolean fMacIsColor; // Not an error: Defined even for Windows see PrivLoadCursor
- };
-
- //----------------------------------------------------------------------------------------
- // FW_CCursor::Show
- //----------------------------------------------------------------------------------------
- inline void FW_CCursor::Show()
- {
- #ifdef FW_BUILD_MAC
- ::ShowCursor();
- #endif
-
- #ifdef FW_BUILD_WIN
- ::ShowCursor(TRUE);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CCursor::Hide
- //----------------------------------------------------------------------------------------
- inline void FW_CCursor::Hide()
- {
- #ifdef FW_BUILD_MAC
- ::HideCursor();
- #endif
-
- #ifdef FW_BUILD_WIN
- ::ShowCursor(FALSE);
- #endif
- }
-
- #endif
-
-
-